package com.hb.znpt.activity;

import android.os.Bundle;

import androidx.databinding.ObservableField;
import androidx.lifecycle.Observer;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.hb.znpt.BR;
import com.hb.znpt.R;
import com.hb.znpt.databinding.ActivityUserInfoBinding;
import com.hb.znpt.viewmodel.UserInfoViewModel;
import com.unitlib.base.base.BaseActivity;

/**
 * @Description: 描述
 * @Author: houbing
 * @CreateDate: 2021/12/18 21:11
 */
public class UserInfoAcitivty extends BaseActivity<ActivityUserInfoBinding, UserInfoViewModel> {

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_user_info;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public void initData() {
        initBackTitle(binding.toolbar);
    }

    @Override
    public void initViewObservable() {
        viewModel.bankData.observe(this, new Observer<String>() {
            @Override
            public void onChanged(String s) {
                Glide.with(context)
                        .load(s)
                        .error(R.drawable.picture_icon_placeholder)
                        .placeholder(R.drawable.picture_icon_placeholder)
                        .into(binding.bankIv);
            }
        });
        viewModel.cardData.observe(this, new Observer<String>() {
            @Override
            public void onChanged(String s) {
                Glide.with(context)
                        .load(s)
                        .error(R.drawable.picture_icon_placeholder)
                        .placeholder(R.drawable.picture_icon_placeholder)
                        .into(binding.cardIv);
            }
        });
    }
}
